The Elder Scrolls Forums

TES Construction Set and Plugins >> General TES Construction Set

Pages: 1
xXBlackDeathXx
Layman

Reged: 08/25/04
Posts: 9
Loc: U.S. Longmont, CO
Scripting Help-Night Eye
      #2969647 - 08/25/04 04:53 PM

I am new to TES scripting, (even though I am a certifiead expert in Visual C++, and C) and I need help with my script to make Night-Eye ONLY activate in the night. I have a basic idea of what it consists of. Basically it would be, get the current time in seconds, if player has spell "night-eye", force cast. Then do a time check in seconds again until the time is morning (6:00 AM) and then make the spell stop. I have a basic idea I just can't put it all together. I also know that I would probably need to make a custom ability called Night-Eye, so that there can't be a time limit in seconds preventing the spell from staying "activated". I hope someone can halp me, or (the preferd way) simply give me the script with some blank information for me to fill out. Please do not mistake me for a n00b I am simply new to TES Scripting but I have done countless mods for Morrowind. (This little feature will be in my latest mod and if you help me I promise to give you credit.) Thanks again.

--------------------
You know you play Morrowind too much when...wait a minute...you can NEVER play too much Morrwind.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Miles_Acraeus
Master

Reged: 08/24/02
Posts: 7891
Loc: Primum Mobile
Re: Scripting Help-Night Eye [Re: xXBlackDeathXx]
      #2970506 - 08/25/04 08:52 PM

You're on the right track, but I'll need some more info first;

1. A script like this would be best executed from a Global Main. Do you have one of the expansions? If so, you could create a script (see below), go to "Gameplay\edit start scripts\add script". Do this once you have your script compiled.

You can't force a player to cast a spell, but you could create an ability with constant effect nighteye, and add/remove that spell depending on the gamehour. Here is a rough idea of what you could do, but you could add other checks for race, faction, item count, etc;

Code:


Begin My_GlobalMain_NightEye

;checks gameHour//removes/adds spell for effect

Short HasEffect

if ( GameHour >= 19 )
if ( HasEffect == 0 )
Player-> AddSpell, "my nighteye"
Set HasEffect to 1
return
endif
return
elseif ( GameHour < 8 )
if ( HasEffect == 0 )
Player-> Addspell, "my nighteye"
Set HasEffect to 1
return
endif
return
endif

if ( HasEffect == 1 )
Player-> RemoveSpell, "my nightEye"
Set HasEffect to 0
endif

End



Of course if you don't have the expansions, then you could kick this script off from something such as dialogue, another script, an activator, etc.

Hope that helps.



--------------------
"Just some spittle in your face." ~ Vladimir Harkonnen



Post Extras: Print Post   Remind Me!   Notify Moderator  
xXBlackDeathXx
Layman

Reged: 08/25/04
Posts: 9
Loc: U.S. Longmont, CO
Re: Scripting Help-Night Eye [Re: Miles_Acraeus]
      #2970595 - 08/25/04 09:23 PM

Thanks this helps me out a lot. Thankfully I have Tribunal, and Bloodmoon installed but Bloodmoon is not working. But again thank you.
Another question, could I use something like this:

Begin Night-Eye night

If ( GameHour >= 17 )
If ( GameHour <= 19 )
“Night-Eye” -> Enable
endif
elseif ( GameHour < 17 )
if ( GameHour >19 )
“Night-Eye” -> Disable
endif
endif


End Night-Eye night

After I have added the spell? Or am I being a complete n00b? lol

--------------------
You know you play Morrowind too much when...wait a minute...you can NEVER play too much Morrwind.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Miles_Acraeus
Master

Reged: 08/24/02
Posts: 7891
Loc: Primum Mobile
Re: Scripting Help-Night Eye [Re: xXBlackDeathXx]
      #2970832 - 08/25/04 10:47 PM

Will this work?

Quote:


Begin Night-Eye night

If ( GameHour >= 17 )
If ( GameHour <= 19 )
“Night-Eye” -> Enable
endif
elseif ( GameHour < 17 )
if ( GameHour >19 )
“Night-Eye” -> Disable
endif
endif


End Night-Eye night





Not really... Disable/enable is a command to control the rendered visual state of an object (enable== yes I can see it, disable== no I can't see it... Dig?), not for the use of adding abilities. The script I posted should work. If you have Tribunal, then add the script to the start script menu, after it's compiled. Make sure you have that spell that you add as an ability so that it's set to "constant effect". If you can't add it to the start scripts, then tell us what you want, and we could do a work around.





--------------------
"Just some spittle in your face." ~ Vladimir Harkonnen



Post Extras: Print Post   Remind Me!   Notify Moderator  
Scythor
Layman

Reged: 08/25/04
Posts: 5
Re: Scripting Help-Night Eye [Re: Miles_Acraeus]
      #2971529 - 08/26/04 04:00 AM

You could possibly check the Maormer plugin by Nazz (available at Morrowind Summit if i remember correctly) He uses a script to give his Maormer race a Chameleon effect when they come in contact with water. If you check for time instead and use a Night-Eye spell (set its type to Ability) you should be able to figure it out. (the script's name in this mod is "maormercloaking")

Post Extras: Print Post   Remind Me!   Notify Moderator  
Zriza
Initiate

Reged: 07/26/04
Posts: 90
Re: Scripting Help-Night Eye [Re: Scythor]
      #2971594 - 08/26/04 04:58 AM

I thought about doing something like this, too (but had no idea how, so never did). An idea I had about it is the Night Eye should turn back on underground (so you don't have to wait until nighttime to see in a cave, etc). That might complicate the scripting a bit, but I think it's a nice added detail.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Archived User Account

Re: Scripting Help-Night Eye [Re: Zriza]
      #2971643 - 08/26/04 05:47 AM

hey this is a good question to ask!

thanx for da info all

Post Extras: Print Post   Remind Me!   Notify Moderator  
xXBlackDeathXx
Layman

Reged: 08/25/04
Posts: 9
Loc: U.S. Longmont, CO
Re: Scripting Help-Night Eye [Re: ]
      #2973088 - 08/26/04 06:20 PM

Thanks for all your help. This is going to help me out in my new mod which is basically a Kahjit enhancement mod and an equlazier for Morrowind to make things, overall, more realistic. For example I'm making about 253 new items, new Races like Dwarf, human, Halfling etc. And even some climbing animation for Argonians and Kahjit so they can accually climb walls and such. But anyway, thanks again for all of your help, I will be sure to give you credit for helping me.

--------------------
You know you play Morrowind too much when...wait a minute...you can NEVER play too much Morrwind.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Miles_Acraeus
Master

Reged: 08/24/02
Posts: 7891
Loc: Primum Mobile
Re: Scripting Help-Night Eye [Re: xXBlackDeathXx]
      #2974015 - 08/26/04 11:11 PM

If it's an ability only for a certain race, then you'll also need a check to see if the player is actually that race.

If ( Player-> GetRace, "khajiit" == 1 )
.....do the rest here


Good luck with the mod.



--------------------
"Just some spittle in your face." ~ Vladimir Harkonnen



Post Extras: Print Post   Remind Me!   Notify Moderator  
xXBlackDeathXx
Layman

Reged: 08/25/04
Posts: 9
Loc: U.S. Longmont, CO
Re: Scripting Help-Night Eye [Re: Miles_Acraeus]
      #2977567 - 08/27/04 10:49 PM

Thanks! this really helped me, thanks again. But before I test it, here is my final script, any corrections, suggestions, etc would be really good.

Code:
Begin My_GlobalMain_NightEye 


;checks gameHour/checks player's race/removes/adds spell for effect

if ( player->GetRace, "Khajiit" == 1 )

Short HasEffect

if ( GameHour >= 19 )
if ( HasEffect == 0 )
Player-> AddSpell, "my_nighteye"
Set HasEffect to 1
return
endif
return
elseif ( GameHour < 8 )
if ( HasEffect == 0 )
Player-> Addspell, "my_nighteye"
Set HasEffect to 1
return
endif
return
endif

if ( HasEffect == 1 )
Player-> RemoveSpell, "my_nightEye"
Set HasEffect to 0
endif

End



--------------------
You know you play Morrowind too much when...wait a minute...you can NEVER play too much Morrwind.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1


Extra information
1 registered and 4 anonymous users are browsing this forum.

Moderator:  Umrahel, Freddo, Pete, Hungry Donner, Attrebus, Miltiades, tegger 

Print Thread

Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 119

Rate this thread
 
Jump to

The Elder Scrolls Homepage

*
UBB.threads™ 6.3

Click for Privacy Statement © 2003 Bethesda Softworks LLC, a ZeniMax Media company. All Rights Reserved.
PRIVACY POLICY | TERMS & CONDITIONS | LEGAL INFORMATION | CONTACT US